<?php
class UnitTestCase_Phlix_Options extends UnitTestCase {

    public function setUp() {
    
        // set up the tests
    
    }
    
    public function tearDown() {
    
        // tear down the tests
    
    }
    /**
     * The options object should work like an array in many ways
     */
    public function testArrayAccess() {
    
        $options = new Phlix_Options();
        // offsetset
        $options['foo'] = 'bar';
        // offsetget
        $this->assertEqual($options['foo'], 'bar');
        // offset unset
        unset($options['foo']);
        // offset exists
        $this->assertFalse(isset($options['foo']));
        
    
    }
    /**
     * It should be possible to initialize the options object with an array
     */
    public function testInstantiateWithArray() {
    
        $options = new Phlix_Options(array(
            'foo' => 'bar',
            'bar' => 'baz'
        ));
        $this->assertEqual($options['foo'], 'bar');
        $this->assertEqual($options['bar'], 'baz');
    
    }
    /**
     * The options object makes use of php5's magic methods
     */
    public function testOptionsObjectMagicMethods() {
    
        $options = new Phlix_Options(array(
            'foo' => 'bar',
            'bar' => 'baz'
        ));
        $this->assertEqual($options->foo, "bar");
        $options['far'] = 'bla';
        $this->assertEqual($options->far, 'bla');
        // __set
        $options->baz = "boo";
        // __get
        $this->assertEqual($options->baz, "boo");
        // __unset
        unset($options->foo);
        // __isset
        $this->assertFalse(isset($options->foo));
    
    }

}